package com.zzptc.oyvshop.db;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class MYsqlDB implements IDB {
    private Connection conn;
    private String DRIVER="com.mysql.jdbc.Driver";
    private String URL="jdbc:mysql://localhost:3306/easy_shop?useUnicode=true&characterEncoding=utf-8";
    private String UNAME="root";
    private String PWD="root";
    @Override
    public Connection getConnection() throws SQLException {
        try {
            Class.forName(DRIVER);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        conn=DriverManager.getConnection(URL,UNAME,PWD);
        return conn;
    }

    @Override
    public void closeConn() throws SQLException {

    }

    public static void main(String[] args) {

    }
}
